<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<?php   session_start();?>
<?php 
 
   if (isset($_SESSION['login'])){
       if ($_SESSION['login']!=1){
	      die("请先<a href='denglu.html'>登录</a>或<a href='zhuce.php'>注册</a>！A");
	   }
	   else{
	   
	   
	     $head='<table width="800" border="1" cellpadding="0" cellspacing="0" align="center">
		 <tr>
				<td width="600">主题</td>
				<td width="100">作者</td>
				<td width="100">时间</td>
			  </tr>
		 ';
       
		 $end="</table>";
		 
		  @mysql_connect("localhost","root","") or die("数据库服务器连接出错！");
	      @mysql_select_db("data") or die("数据库选择出错！");
		  
	      $querystr="select * from title";
		  $result=mysql_query($querystr);
		  
		  echo $head;
		  
		  while(list($title_id,$BBS_user,$BBS_title,$BBS_content,$BBS_time)=mysql_fetch_array($result)){
		       $body="			 
			  <tr>
				<td><a href='bbsreply.php?titleid=$title_id'>$BBS_title</a></td>
				<td>$BBS_user</td>
				<td>$BBS_time</td>
			  </tr>
			  ";		       
		      echo $body;
		  }		
		  echo $end;
	   }
   }
   else{
       die("请先<a href='denglu.html'>登录</a>或<a href='zhuce.php'>注册</a>！B");
   }
?>

<br />
<br />
<form id="form1" name="form1" method="post" action="titleadd.php">
  <table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="65" height="27" valign="middle">标题：      </td>
      <td width="729" valign="middle"><input name="title" type="text" id="title" size="60" /></td>
    </tr>
    <tr>
      <td height="147" valign="top">内容：</td>
      <td valign="top"><textarea name="content" cols="100" rows="12" id="content"></textarea></td>
    </tr>
    <tr>
      <td height="49">&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="发帖" /></td>
    </tr>
  </table>
</form>
</body>
</html>